export const MSG_TYPE = {
  INIT_VOLUME: 'init-volume',
  GET_STORAGE_VOLUME : 'get-storage-volume',
  SET_STORAGE_VOLUME : 'set-storage-volume',
  GET_TAB_VOLUME: 'get-tab-volume',
  SET_TAB_VOLUME: 'set-tab-volume',
} as const

type Message = {
  name: typeof MSG_TYPE.INIT_VOLUME,
  value: number
} | {
  name: typeof MSG_TYPE.GET_STORAGE_VOLUME,
  value: number
} | {
  name: typeof MSG_TYPE.SET_STORAGE_VOLUME,
  value: number
} | {
  name: typeof MSG_TYPE.GET_TAB_VOLUME,
  tabId: number
} | {
  name: typeof MSG_TYPE.SET_TAB_VOLUME,
  tabId: number,
  value: number
}

export default Message
